<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>BabyOS: b_ota.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="baby_boy_93.528712871287px_1234786_easyicon.net.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">BabyOS
   &#160;<span id="projectnumber">V0.0.1</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.14 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_b9223522bb56aee4ab59f7ba381d2163.html">bos</a></li><li class="navelem"><a class="el" href="dir_f2a2cc749b6bfcea90db6730434b0bd6.html">core</a></li><li class="navelem"><a class="el" href="dir_37b66dfbfdffce01c33ebea49c49c2c3.html">inc</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">b_ota.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="b__ota_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#ifndef __B_OTA_H__</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#define __B_OTA_H__</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160; <span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="comment">/*Includes ----------------------------------------------*/</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="b__config_8h.html">b_config.h</a>&quot;</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#if (_PROTO_ENABLE &amp;&amp; _PROTO_OTA_ENABLE) </span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;<span class="preprocessor">#pragma pack(1)</span></div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="structb_o_t_a___f_w_info__t.html">   60</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;{</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="structb_o_t_a___f_w_info__t.html#a2ca16b35ded07b71a04f638169e07719">   62</a></span>&#160;    uint32_t <a class="code" href="structb_o_t_a___f_w_info__t.html#a2ca16b35ded07b71a04f638169e07719">f_size</a>;</div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="structb_o_t_a___f_w_info__t.html#a4bceb1a193c0bebe178c870c978f3966">   63</a></span>&#160;    uint32_t <a class="code" href="structb_o_t_a___f_w_info__t.html#a4bceb1a193c0bebe178c870c978f3966">f_crc32</a>;</div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="structb_o_t_a___f_w_info__t.html#a3835e475bd5101f82d3f66e02a3cee73">   64</a></span>&#160;    uint32_t <a class="code" href="structb_o_t_a___f_w_info__t.html#a3835e475bd5101f82d3f66e02a3cee73">f_key</a>;</div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;}<a class="code" href="structb_o_t_a___f_w_info__t.html">bOTA_FWInfo_t</a>;</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="structb_o_t_a___f_w_data__t.html">   67</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;{</div><div class="line"><a name="l00069"></a><span class="lineno"><a class="line" href="structb_o_t_a___f_w_data__t.html#adf69c46b3dd2878c66bab78eddc40b04">   69</a></span>&#160;    uint16_t <a class="code" href="structb_o_t_a___f_w_data__t.html#adf69c46b3dd2878c66bab78eddc40b04">number</a>;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="structb_o_t_a___f_w_data__t.html#a5b1ae998eed54d1d68c0163bab9fbf5f">   70</a></span>&#160;    uint8_t buf[<a class="code" href="b__config_8h.html#a771e0a2ceaed0caf6945c2774e68324a">_OTA_BUFF_SIZE</a>];</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;}<a class="code" href="structb_o_t_a___f_w_data__t.html">bOTA_FWData_t</a>;</div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="structb_o_t_a___f_w_a_c_k__t.html">   73</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;{</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structb_o_t_a___f_w_a_c_k__t.html#adf69c46b3dd2878c66bab78eddc40b04">   75</a></span>&#160;    uint16_t <a class="code" href="structb_o_t_a___f_w_a_c_k__t.html#adf69c46b3dd2878c66bab78eddc40b04">number</a>;</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;}<a class="code" href="structb_o_t_a___f_w_a_c_k__t.html">bOTA_FWACK_t</a>;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;<span class="preprocessor">#pragma pack()</span></div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="structb_o_t_a___ctl__t.html">   81</a></span>&#160;<span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;{</div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="structb_o_t_a___ctl__t.html#ade818037fd6c985038ff29656089758d">   83</a></span>&#160;    uint8_t <a class="code" href="structb_o_t_a___ctl__t.html#ade818037fd6c985038ff29656089758d">status</a>;</div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="structb_o_t_a___ctl__t.html#adf69c46b3dd2878c66bab78eddc40b04">   84</a></span>&#160;    uint16_t <a class="code" href="structb_o_t_a___ctl__t.html#adf69c46b3dd2878c66bab78eddc40b04">number</a>;</div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="structb_o_t_a___ctl__t.html#a36b7cfe17c86a3b14ebc0e7b38da5684">   85</a></span>&#160;    <span class="keywordtype">int</span> <a class="code" href="structb_o_t_a___ctl__t.html#a36b7cfe17c86a3b14ebc0e7b38da5684">data_no</a>;</div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="structb_o_t_a___ctl__t.html#a858e2685fb0034acadcd8d48cf6f02b2">   86</a></span>&#160;    uint8_t <a class="code" href="structb_o_t_a___ctl__t.html#a858e2685fb0034acadcd8d48cf6f02b2">dev_no</a>;</div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="structb_o_t_a___ctl__t.html#ad4a22c2100434cc2f3c30c99bb5a4caf">   87</a></span>&#160;    uint8_t <a class="code" href="structb_o_t_a___ctl__t.html#ad4a22c2100434cc2f3c30c99bb5a4caf">pro_no</a>;</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;}<a class="code" href="structb_o_t_a___ctl__t.html">bOTA_Ctl_t</a>;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="group___o_t_a___exported___defines.html#ga4535ce4bb09ae7816d8e78d56511291a">  101</a></span>&#160;<span class="preprocessor">#define BOTA_CMD_FW_START           0XE2</span></div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="group___o_t_a___exported___defines.html#gac3d822fe5ca5a0a9c76ac0ac4caaebf1">  102</a></span>&#160;<span class="preprocessor">#define BOTA_CMD_FW_DATA            0XE3</span></div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="group___o_t_a___exported___defines.html#ga890423ccabd280c499bc2bb8f9b7e80e">  103</a></span>&#160;<span class="preprocessor">#define BOTA_CMD_FW_ACK             0XE4</span></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;</div><div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="group___o_t_a___exported___defines.html#ga827a638010a299cf6392334b10f4ad19">  106</a></span>&#160;<span class="preprocessor">#define BOTA_S_NULL                 0</span></div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="group___o_t_a___exported___defines.html#gad572630a2854c436a18db032de30e377">  107</a></span>&#160;<span class="preprocessor">#define BOTA_S_ING                  1</span></div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="group___o_t_a___exported___defines.html#gade40ce38a70a0aa2b0b287a9c25f679b">  109</a></span>&#160;<span class="preprocessor">#define BOTA_SECTOR_SIZE            0X1000</span></div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;</div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___o_t_a___exported___functions.html#ga53bdf541bdf76ac8ee66d2070a6f5ddd">bOTA_Init</a>(uint8_t dev_no, uint8_t pro_no);</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;<span class="keywordtype">int</span> <a class="code" href="group___o_t_a___exported___functions.html#gad41cc6e45b993447b7066ba67882a10b">bOTA_Parse</a>(uint8_t *pbuf, uint16_t len);</div><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;</div><div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;<span class="preprocessor">#ifdef __cplusplus</span></div><div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;    }</div><div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;</div><div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;<span class="preprocessor">#endif  </span></div><div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;</div><div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;<span class="comment">/************************ Copyright (c) 2019 Bean *****END OF FILE****/</span></div><div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;</div><div class="ttc" id="structb_o_t_a___ctl__t_html_ad4a22c2100434cc2f3c30c99bb5a4caf"><div class="ttname"><a href="structb_o_t_a___ctl__t.html#ad4a22c2100434cc2f3c30c99bb5a4caf">bOTA_Ctl_t::pro_no</a></div><div class="ttdeci">uint8_t pro_no</div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00087">b_ota.h:87</a></div></div>
<div class="ttc" id="structb_o_t_a___f_w_data__t_html_adf69c46b3dd2878c66bab78eddc40b04"><div class="ttname"><a href="structb_o_t_a___f_w_data__t.html#adf69c46b3dd2878c66bab78eddc40b04">bOTA_FWData_t::number</a></div><div class="ttdeci">uint16_t number</div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00069">b_ota.h:69</a></div></div>
<div class="ttc" id="group___o_t_a___exported___functions_html_gad41cc6e45b993447b7066ba67882a10b"><div class="ttname"><a href="group___o_t_a___exported___functions.html#gad41cc6e45b993447b7066ba67882a10b">bOTA_Parse</a></div><div class="ttdeci">int bOTA_Parse(uint8_t *pbuf, uint16_t len)</div></div>
<div class="ttc" id="structb_o_t_a___ctl__t_html_ade818037fd6c985038ff29656089758d"><div class="ttname"><a href="structb_o_t_a___ctl__t.html#ade818037fd6c985038ff29656089758d">bOTA_Ctl_t::status</a></div><div class="ttdeci">uint8_t status</div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00083">b_ota.h:83</a></div></div>
<div class="ttc" id="structb_o_t_a___f_w_a_c_k__t_html"><div class="ttname"><a href="structb_o_t_a___f_w_a_c_k__t.html">bOTA_FWACK_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00073">b_ota.h:73</a></div></div>
<div class="ttc" id="group___o_t_a___exported___functions_html_ga53bdf541bdf76ac8ee66d2070a6f5ddd"><div class="ttname"><a href="group___o_t_a___exported___functions.html#ga53bdf541bdf76ac8ee66d2070a6f5ddd">bOTA_Init</a></div><div class="ttdeci">int bOTA_Init(uint8_t dev_no, uint8_t pro_no)</div></div>
<div class="ttc" id="structb_o_t_a___f_w_info__t_html_a2ca16b35ded07b71a04f638169e07719"><div class="ttname"><a href="structb_o_t_a___f_w_info__t.html#a2ca16b35ded07b71a04f638169e07719">bOTA_FWInfo_t::f_size</a></div><div class="ttdeci">uint32_t f_size</div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00062">b_ota.h:62</a></div></div>
<div class="ttc" id="structb_o_t_a___f_w_info__t_html_a3835e475bd5101f82d3f66e02a3cee73"><div class="ttname"><a href="structb_o_t_a___f_w_info__t.html#a3835e475bd5101f82d3f66e02a3cee73">bOTA_FWInfo_t::f_key</a></div><div class="ttdeci">uint32_t f_key</div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00064">b_ota.h:64</a></div></div>
<div class="ttc" id="b__config_8h_html"><div class="ttname"><a href="b__config_8h.html">b_config.h</a></div></div>
<div class="ttc" id="structb_o_t_a___f_w_data__t_html"><div class="ttname"><a href="structb_o_t_a___f_w_data__t.html">bOTA_FWData_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00067">b_ota.h:67</a></div></div>
<div class="ttc" id="b__config_8h_html_a771e0a2ceaed0caf6945c2774e68324a"><div class="ttname"><a href="b__config_8h.html#a771e0a2ceaed0caf6945c2774e68324a">_OTA_BUFF_SIZE</a></div><div class="ttdeci">#define _OTA_BUFF_SIZE</div><div class="ttdef"><b>Definition:</b> <a href="b__config_8h_source.html#l00130">b_config.h:130</a></div></div>
<div class="ttc" id="structb_o_t_a___f_w_info__t_html"><div class="ttname"><a href="structb_o_t_a___f_w_info__t.html">bOTA_FWInfo_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00060">b_ota.h:60</a></div></div>
<div class="ttc" id="structb_o_t_a___ctl__t_html_adf69c46b3dd2878c66bab78eddc40b04"><div class="ttname"><a href="structb_o_t_a___ctl__t.html#adf69c46b3dd2878c66bab78eddc40b04">bOTA_Ctl_t::number</a></div><div class="ttdeci">uint16_t number</div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00084">b_ota.h:84</a></div></div>
<div class="ttc" id="structb_o_t_a___ctl__t_html"><div class="ttname"><a href="structb_o_t_a___ctl__t.html">bOTA_Ctl_t</a></div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00081">b_ota.h:81</a></div></div>
<div class="ttc" id="structb_o_t_a___f_w_info__t_html_a4bceb1a193c0bebe178c870c978f3966"><div class="ttname"><a href="structb_o_t_a___f_w_info__t.html#a4bceb1a193c0bebe178c870c978f3966">bOTA_FWInfo_t::f_crc32</a></div><div class="ttdeci">uint32_t f_crc32</div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00063">b_ota.h:63</a></div></div>
<div class="ttc" id="structb_o_t_a___f_w_a_c_k__t_html_adf69c46b3dd2878c66bab78eddc40b04"><div class="ttname"><a href="structb_o_t_a___f_w_a_c_k__t.html#adf69c46b3dd2878c66bab78eddc40b04">bOTA_FWACK_t::number</a></div><div class="ttdeci">uint16_t number</div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00075">b_ota.h:75</a></div></div>
<div class="ttc" id="structb_o_t_a___ctl__t_html_a36b7cfe17c86a3b14ebc0e7b38da5684"><div class="ttname"><a href="structb_o_t_a___ctl__t.html#a36b7cfe17c86a3b14ebc0e7b38da5684">bOTA_Ctl_t::data_no</a></div><div class="ttdeci">int data_no</div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00085">b_ota.h:85</a></div></div>
<div class="ttc" id="structb_o_t_a___ctl__t_html_a858e2685fb0034acadcd8d48cf6f02b2"><div class="ttname"><a href="structb_o_t_a___ctl__t.html#a858e2685fb0034acadcd8d48cf6f02b2">bOTA_Ctl_t::dev_no</a></div><div class="ttdeci">uint8_t dev_no</div><div class="ttdef"><b>Definition:</b> <a href="b__ota_8h_source.html#l00086">b_ota.h:86</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.14
</small></address>
</body>
</html>
